home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_include / ASM-MIPS / IDE.H < prev    next >
C/C++ Source or Header  |  1999-09-17  |  3KB  |  123 lines

  1. /* $Id: ide.h,v 1.4 1998/05/08 21:05:26 davem Exp $
  2.  *
  3.  *  linux/include/asm-mips/ide.h
  4.  *
  5.  *  Copyright (C) 1994-1996  Linus Torvalds & authors
  6.  */
  7.  
  8. /*
  9.  *  This file contains the MIPS architecture specific IDE code.
  10.  */
  11.  
  12. #ifndef __ASM_MIPS_IDE_H
  13. #define __ASM_MIPS_IDE_H
  14.  
  15. #ifdef __KERNEL__
  16.  
  17. typedef unsigned short ide_ioreg_t;
  18.  
  19. #ifndef MAX_HWIFS
  20. #define MAX_HWIFS    6
  21. #endif
  22.  
  23. #define ide__sti()    __sti()
  24.  
  25. struct ide_ops {
  26.     int (*ide_default_irq)(ide_ioreg_t base);
  27.     ide_ioreg_t (*ide_default_io_base)(int index);
  28.     void (*ide_init_hwif_ports)(ide_ioreg_t *p, ide_ioreg_t base, int *irq);
  29.     int (*ide_request_irq)(unsigned int irq, void (*handler)(int, void *,
  30.                            struct pt_regs *), unsigned long flags,
  31.                            const char *device, void *dev_id);
  32.     void (*ide_free_irq)(unsigned int irq, void *dev_id);
  33.     int (*ide_check_region) (ide_ioreg_t from, unsigned int extent);
  34.     void (*ide_request_region)(ide_ioreg_t from, unsigned int extent,
  35.                             const char *name);
  36.     void (*ide_release_region)(ide_ioreg_t from, unsigned int extent);
  37. };
  38.  
  39. extern struct ide_ops *ide_ops;
  40.  
  41. static __inline__ int ide_default_irq(ide_ioreg_t base)
  42. {
  43.     return ide_ops->ide_default_irq(base);
  44. }
  45.  
  46. static __inline__ ide_ioreg_t ide_default_io_base(int index)
  47. {
  48.     return ide_ops->ide_default_io_base(index);
  49. }
  50.  
  51. static __inline__ void ide_init_hwif_ports(ide_ioreg_t *p, ide_ioreg_t base,
  52.                                            int *irq)
  53. {
  54.     ide_ops->ide_init_hwif_ports(p, base, irq);
  55. }
  56.  
  57. typedef union {
  58.     unsigned all            : 8;    /* all of the bits together */
  59.     struct {
  60.         unsigned head        : 4;    /* always zeros here */
  61.         unsigned unit        : 1;    /* drive select number, 0 or 1 */
  62.         unsigned bit5        : 1;    /* always 1 */
  63.         unsigned lba        : 1;    /* using LBA instead of CHS */
  64.         unsigned bit7        : 1;    /* always 1 */
  65.     } b;
  66.     } select_t;
  67.  
  68. static __inline__ int ide_request_irq(unsigned int irq, void (*handler)(int,void *, struct pt_regs *),
  69.             unsigned long flags, const char *device, void *dev_id)
  70. {
  71.     return ide_ops->ide_request_irq(irq, handler, flags, device, dev_id);
  72. }
  73.  
  74. static __inline__ void ide_free_irq(unsigned int irq, void *dev_id)
  75. {
  76.     ide_ops->ide_free_irq(irq, dev_id);
  77. }
  78.  
  79. static __inline__ int ide_check_region (ide_ioreg_t from, unsigned int extent)
  80. {
  81.     return ide_ops->ide_check_region(from, extent);
  82. }
  83.  
  84. static __inline__ void ide_request_region(ide_ioreg_t from,
  85.                                           unsigned int extent, const char *name)
  86. {
  87.     ide_ops->ide_request_region(from, extent, name);
  88. }
  89.  
  90. static __inline__ void ide_release_region(ide_ioreg_t from,
  91.                                           unsigned int extent)
  92. {
  93.     ide_ops->ide_release_region(from, extent);
  94. }
  95.  
  96. /*
  97.  * The following are not needed for the non-m68k ports
  98.  */
  99. static __inline__ int ide_ack_intr (ide_ioreg_t status_port,
  100.                                     ide_ioreg_t irq_port)
  101. {
  102.     return 1;
  103. }
  104.  
  105. static __inline__ void ide_fix_driveid(struct hd_driveid *id)
  106. {
  107. }
  108.  
  109. static __inline__ void ide_release_lock (int *ide_lock)
  110. {
  111. }
  112.  
  113. static __inline__ void ide_get_lock (int *ide_lock,
  114.                                      void (*handler)(int, void *,
  115.                                                     struct pt_regs *),
  116.                                      void *data)
  117. {
  118. }
  119.  
  120. #endif /* __KERNEL__ */
  121.  
  122. #endif /* __ASM_MIPS_IDE_H */
  123.